From: Abderrahim Kitouni Date: Sat, 16 Jan 2021 15:29:05 +0000 (+0100) Subject: workspacesView: Fix scroll direction in RTL locales X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~527 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=698e67c48665fe7f73105f5f995a3b9438b767eb;p=gnome-shell.git workspacesView: Fix scroll direction in RTL locales Scrolling up or down (using the mouse wheel) should scroll to right or left respectively (rather than the other way around). Part-of: --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index ef3e5f68c..f39d305b7 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -787,18 +787,23 @@ class WorkspacesDisplay extends St.Widget { let workspaceManager = global.workspace_manager; const vertical = workspaceManager.layout_rows === -1; + const rtl = this.text_direction === Clutter.TextDirection.RTL; let activeWs = workspaceManager.get_active_workspace(); let ws; switch (direction) { case Clutter.ScrollDirection.UP: if (vertical) ws = activeWs.get_neighbor(Meta.MotionDirection.UP); + else if (rtl) + ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT); else ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT); break; case Clutter.ScrollDirection.DOWN: if (vertical) ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN); + else if (rtl) + ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT); else ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT); break;